|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPER.rover.DriveToAction
Drives the trikebot a specified distance, after first turning by a set angle (which can be 0).
Field Summary | |
static byte |
CYCLE_SAFETY
The safety level where it will cycle through the specified safety points |
static byte |
NO_SAFETY
The safety level where no checking is done |
static byte |
STATIC_SAFETY
The safety level where it will keep the head at pan=0, tilt=-35 |
Constructor Summary | |
DriveToAction(int fwd)
Creates a new DriveToAction that moves straight ahead taking pictures with safety on. |
|
DriveToAction(int fwd,
int ang,
boolean safety)
Creates a new DriveToAction that takes pictures. |
|
DriveToAction(int fwd,
int ang,
byte safetyLevel,
boolean takePics)
Creates a new DriveToAction. |
Method Summary | |
boolean |
doAction(Rover r)
Tries to start the action. |
long |
getImageUpdateTime()
Lets you know when the last image was taken by this action. |
java.awt.image.BufferedImage |
getRecentImage()
Returns the most recent image taken by this Action. |
int |
getReturnValue()
The return value of the Action. |
java.lang.String |
getShortSummary()
Provides a shortened version of the summary returned by getSummary. |
java.lang.String |
getSummary()
Provides a textual explanation of the Action, such as "turn 90 degrees" |
int |
getTime()
How long the action will take, in milliseconds. |
int |
getTimeRemaining()
How much time until the action finishes (in milliseconds), if it has already started. |
boolean |
isCompleted()
Whether the action has completed. |
boolean |
isSuccess()
Whether the action completed successfully. |
void |
kill()
Emergency stop - end the action immediately, if it's running. |
void |
setAngle(int ang)
Sets the angle to the given degree (0=straight, 90=left, -90=right). |
void |
setDistance(int distance)
Sets the distance to the given cm value and recalculates how long the action will take. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte NO_SAFETY
public static final byte CYCLE_SAFETY
public static final byte STATIC_SAFETY
Constructor Detail |
public DriveToAction(int fwd)
fwd
- centimeters to move forward (after rotating)public DriveToAction(int fwd, int ang, boolean safety)
fwd
- centimeters to move forwardang
- the angle to drive at (0=straight, 90=left, -90=right)safety
- if true, rover will stop based on the range finderpublic DriveToAction(int fwd, int ang, byte safetyLevel, boolean takePics)
fwd
- centimeters to move forwardang
- the angle to drive at (0=straight, 90=left, -90=right)safetyLevel
- CYCLE_SAFETY, STATIC_SAFETY, or NO_SAFETYtakePics
- if true, the rover will take pictures as it drivesMethod Detail |
public void setDistance(int distance)
public void setAngle(int ang)
public boolean doAction(Rover r)
Action
doAction
in interface Action
public int getTime()
Action
getTime
in interface Action
public java.lang.String getSummary()
Action
getSummary
in interface Action
public java.lang.String getShortSummary()
Action
getShortSummary
in interface Action
public int getReturnValue()
Action
getReturnValue
in interface Action
RoverState
,
ActionConstants
public boolean isSuccess()
Action
isSuccess
in interface Action
public boolean isCompleted()
Action
isCompleted
in interface Action
public void kill()
Action
kill
in interface Action
public int getTimeRemaining()
Action
getTimeRemaining
in interface Action
public long getImageUpdateTime()
Action
getImageUpdateTime
in interface Action
public java.awt.image.BufferedImage getRecentImage()
Action
getRecentImage
in interface Action
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |